package com.yycwxt.modules.admin.cgj_xscb_gdpdk.cgj;

import com.yycwxt.modules.admin.data_import.ImpFile;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * Created by Mr.Zhang on 2022/9/15 21:51
 */
@Mapper
public interface ImpCgjMapper {

    @Select("select b.id,a.value name,b.filename,b.zq,b.url,b.remark,b.created from\n" +
            "        (select distinct value value from sys_dictionary where name='文件清单') a\n" +
            "            left outer join imp_files b on a.value=b.name and b.zq=#{zq}")
    public List<ImpFile> selectImpFiles(@Param("zq") Integer zq);


    // 调用采购价格存储过程
    @Select("""
            call impCgj(
                #{hpmc,mode=IN,jdbcType=VARCHAR},       
                #{sjbm,mode=IN,jdbcType=VARCHAR},
                #{cgj1,mode=IN,jdbcType=DECIMAL},
                #{cgj2,mode=IN,jdbcType=DECIMAL},
                #{tjrq,mode=IN,jdbcType=TIMESTAMP},
                #{zq,mode=IN,jdbcType=INTEGER});
            """)
    public void impCgj(String hpmc, String sjbm, BigDecimal cgj1, BigDecimal cgj2, LocalDateTime tjrq, Integer zq);


}
